package com.sky.controller.admin;

import com.sky.dto.OrdersPageQueryDTO;
import com.sky.dto.OrdersSubmitDTO;
import com.sky.result.PageResult;
import com.sky.result.Result;
import com.sky.service.OrderService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin/order")
public class OrderController {
    @Autowired
    private OrderService orderService;
//    @GetMapping("/conditionSearch")
//
//    public Result wyx(OrdersPageQueryDTO ordersPageQueryDTO){
//        return Result.success();
//    }
//
//    @GetMapping("/conditionSearch")
//
//    public Result wyx1(OrdersPageQueryDTO ordersPageQueryDTO){
//        return Result.success();
//    }

    /**
     * 订单搜索
     *
     * @param ordersPageQueryDTO
     * @return
     */
    @GetMapping("/conditionSearch")
    @ApiOperation("订单搜索")
    public Result<PageResult> conditionSearch(OrdersPageQueryDTO ordersPageQueryDTO) {
        PageResult pageResult = orderService.conditionSearch(ordersPageQueryDTO);
        return Result.success(pageResult);
    }

    @GetMapping("/statistics")
    @ApiOperation("未知功能的statistics")
    public Result<String> statistics(OrdersPageQueryDTO ordersPageQueryDTO) {
        PageResult pageResult = orderService.conditionSearch(ordersPageQueryDTO);
       // return Result.success(pageResult);
        return Result.success("你好");
       // return null;
    }
}
